package ClassExercise;

public class TriangularCylinder extends Cylinder{
    //假设是直角三角形了
    private double RighgAngleLength1;
    private double RighgAngleLength2;
    public double calculateArea() {
        return RighgAngleLength1*RighgAngleLength2*this.getH()/2;
    }

    public TriangularCylinder(double RighgAngleLength1,double RighgAngleLength2) {
        this.RighgAngleLength1=RighgAngleLength1;
        this.RighgAngleLength2=RighgAngleLength2;
    }


    //测试
    public static void main(String[] args) {
        TriangularCylinder triangular = new TriangularCylinder(2.0,2.0);
        triangular.setH(2.0);
        System.out.println(triangular.calculateArea());
    }
}
